/*
 * testWidget.cpp
 *
 *  Created on: 24/09/2011
 *      Author: andrea
 */
/*
 *
 * PROBADO DESDE APPLICATION...
 *
 * PROBADO: -  AGREGAR SURFACE A WIDGET
 *          -  AGREGAR LISTENER A WIDGET
 *          -  RESPUESTA DEL WIDGET AL EVENTO
 *
 *          it works, motherfuckers!
 *
void Application::run(){
	bool quit = false;
	this->initialize();


    Surface* surface3 = new Surface(0, 0, 64, 128);
    SDL_Rect offset3;
    offset3.x = 450;
    offset3.y = 300;
    surface3->loadSurfaceImage("res/img/foo.png");

    TestListener* listener = new TestListener();

    Widget* widget = new Widget();
    widget->setSurface(surface3);
    widget->setListener(listener);

	this->engine->drawSurface(surface3, offset3);
    this->engine->refreshScreen();

	Event event;

    while( quit == false ) {
    	if (this->engine->pollEvent(&event)) {
    		//this->activeWindow.processEvent(event);
    		//this->engine->drawSurface(this->activeWindow->getSurface());
    		widget->handleEvent(event);
    		widget->handleEvent(event); //solo para probar que anda el handleEvent del widget
    		if (event.getType() == Quit){
    			break; }
    	}
    }
    this->engine->stop();

}*/
